package com.qf.om;

class Student {
    public int age;
    public String name;

    public Student() {
    }

    @Override
    public String toString() {
        return "Student{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }

    public Student(int age, String name) {
        this.age = age;
        this.name = name;

    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}

public class Solution {
    public static void main(String[] args) {
        Student s = new Student(18, "小明");
        Student s2 = new Student(19, "小刚");
        change(s, s2);
        System.out.println(s);
        System.out.println(s2);
    }

    public static void change(Student s1, Student s2) {
        String temp= s1.getName();
        s1.setName(s2.getName());
        s2.setName(temp);


    }

}

